#coding:utf-8
'''
Created on 2015��4��17��

@author: guowu
'''
import os

import ctypes
 
ip="192.168.7.198"
strs = u"个人网盘"
strss = strs.encode("GB2312")
handler = 0
ccmd = 'reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##%s#taskdisk /v _LabelFromReg /d "%s" /f '%(ip,strss)
operator = "open"
fpath = "C:\Windows\system32\cmd.exe"
param = "/c " + ccmd
dirpath = None
ncmd = 1

print param

# shell32 = ctypes.windll.LoadLibrary("shell32.dll");
# shell32.ShellExecuteA(handler,operator,fpath,param,dirpath,ncmd)

#os.system("cmd.exe")

ip="192.168.7.198"
#         try:
command = r'net use "Y": \\%s\taskdisk "teacher" /user:"teacher" '%ip
#             command = r'net use "Y": \\%s\taskdisk "teacher" /user:"teacher" '%mainServerAddr   
#print os.system(command)  

strs = u"个人网盘"
strss = strs.encode("gbk")
cmd =  'reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##%s#taskdisk /v _LabelFromReg /d "%s" /f '%(ip,strss)
print cmd
os.system(cmd)